<?php
function insert_friendConnect($args) {
	if (!isset($args['id']))
		$args['id'] = "div-gfcm";
	if (!isset($args['rows']))
		$args['rows'] = 4;
	echo <<<END
	<!-- Include the Google Friend Connect javascript library. -->
	<script type="text/javascript">JSON.stringify = JSON.encode; JSON.parse = JSON.decode;</script>
	<script type="text/javascript" src="http://www.google.com/friendconnect/script/friendconnect.js"></script>
	<!-- Define the div tag where the gadget will be inserted. -->
	<div id="$args[id]" style="width:200px;"></div>
	<!-- Render the gadget into a div. -->
	<script type="text/javascript">
	var skin = {};
	skin['BORDER_COLOR'] = 'transparent';
	skin['ENDCAP_BG_COLOR'] = '#e0ecff';
	skin['ENDCAP_TEXT_COLOR'] = '#333333';
	skin['ENDCAP_LINK_COLOR'] = $$('#nav a')[0].getStyle('color');
	skin['ALTERNATE_BG_COLOR'] = '#ffffff';
	skin['CONTENT_BG_COLOR'] = '#ffffff';
	skin['CONTENT_LINK_COLOR'] = $$('#nav a')[0].getStyle('color');
	skin['CONTENT_TEXT_COLOR'] = '#333333';
	skin['CONTENT_SECONDARY_LINK_COLOR'] = $$('#nav a')[0].getStyle('color');
	skin['CONTENT_SECONDARY_TEXT_COLOR'] = '#666666';
	skin['CONTENT_HEADLINE_COLOR'] = '#333333';
	skin['NUMBER_ROWS'] = '$args[rows]';
	google.friendconnect.container.setParentUrl('/' /* location of rpc_relay.html and canvas.html */);
	google.friendconnect.container.renderMembersGadget(
	 { id: '$args[id]',
	   site: '$args[site]' },
	  skin);
	</script>
END;
}
?>